package com.jml.jdk8.方法引用;

import lombok.Data;

/**
 * @Author: J
 * @DATE: 2022-04-15 15:56
 */
@Data
public class Student001 {
    private String name;
    private int score;

    public int compareScore(Student001 student) {
        return this.score - student.score;
    }

    public int compareName(Student001 student) {
        return this.getName().compareToIgnoreCase(student.getName());
    }

    //按照分数比较
    public int compareStudentByScore(Student001 student1, Student001 student2) {
        return student1.getScore() - student2.getScore();
    }
}
